//
// Created by mazaiting on 2024/4/27.
//

#include <bits/stdc++.h>

// 求和
bool Sum1(int n, int &s) {
    if (n < 1) return false;
    s = n * (n+1) / 2;
    return true;
}

int main()
{
    int n = 5, s;
    if (Sum1(n, s))
        printf("1到%d的和=%d\n",n,s);
    else
        printf("参数n错误\n");
    return 0;
}